Deepak Bastola
  • Research Projects
  • Courses
  • CV
  • Packages

On this page

  • 1 Three Hidden Traps in Real-World Time-Series Forecasting
  • 2 Step 1: Strictly Causal Renewal Ratios and Validation Lookback Selection
  • 3 Step 2: Non-Overlapping Horizon Benchmarks (\(H = 7\text{d}\)) and Permutation Attribution
  • 4 Exploring Further: Research Directions

Causal Renewal Ratios and Lookback Selection in Multi-Wave Time Series

An Undergraduate Guide to Preventing Look-Ahead Leakage, Adjusting for Rolling-Window Overlap, and Selecting Memory Horizons

Author

Deepak Bastola

Published

October 23, 2026

1 Three Hidden Traps in Real-World Time-Series Forecasting

When students first train recurrent neural networks or sequence regressors on multi-wave time series (such as epidemic incidence curves or seasonal environmental loads), three subtle methodological traps frequently produce misleadingly optimistic results:

  1. Look-Ahead Leakage in Pre-Computed Features: Publicly downloadable indicators (such as smoothed reproduction rates \(R_t\) or centered trend indices) often use two-sided smoothing filters that peek into future observations \(t+1, \dots, t+k\).
  2. Mechanical Rolling-Window Overlap: When the target variable \(I_t\) is a 7-day trailing average, tomorrow’s value shares 6 out of 7 days with today’s value! Any model that simply predicts “tomorrow equals today” (Persistence) will automatically achieve \(R^2 > 0.99\) at a 1-day horizon.
  3. Test-Set Lookback Cherry-Picking: Tuning the encoder memory window \(L\) on the final test wave rather than on a chronological validation wave overstates out-of-sample generalization.

This module demonstrates how to build a rigorous, leakage-free multi-wave forecasting pipeline that addresses all three challenges.

2 Step 1: Strictly Causal Renewal Ratios and Validation Lookback Selection

In infectious disease epidemiology and self-exciting point processes, current incidence \(I_t\) is driven by trailing incidence weighted by a generation-interval distribution \(w_\tau\):

\[\mathbb{E}[I_t \mid I_{1:t-1}] = R_t \sum_{\tau=1}^{L} w_\tau I_{t-\tau}.\]

To ensure zero look-ahead leakage while accounting for administrative reporting turnaround delays (\(b = 7\) days), we construct a strictly causal trailing renewal ratio using only observations available at or before day \(t - b\):

\[\hat{R}_t^{\mathrm{causal}} = \frac{\sum_{k=0}^{6} I_{t-b-k}}{\sum_{k=7}^{13} I_{t-b-k}}, \qquad b = 7\text{ days}.\]

2.1 Selecting Memory Window \(L\) on the Validation Split (\(L_{\mathrm{val}}^* = 14\) Days)

We partition the multi-wave chronology into 65% Training, 15% Validation (Wave 2), and 20% Held-Out Test (Wave 3) and evaluate candidate lookback windows \(L \in \{7, 14, 21, 31, 45, 60\}\) days:

  • Why \(L_{\mathrm{val}}^* = 14\text{ Days}\) Wins on Validation: A 14-day window spans two complete 7-day reporting cycles (capturing weekend reporting troughs and mid-week backlogs) while matching the 5-to-14-day biological incubation-plus-reporting turnaround window, achieving the lowest validation error (\(\mathrm{Val\;MAPE} = 2.93\%\)).
  • Validation Selection vs. Post-Hoc Test Minimum: On the held-out Wave 3 surge, the validation-selected \(L_{\mathrm{val}}^* = 14\text{d}\) model achieves \(\mathrm{Test\;MAPE} = 4.37\%\) (\(+21.6\%\) MSE skill over 7-day persistence), whereas a 31-day window achieves the lowest post-hoc test error (\(\mathrm{Test\;MAPE} = 3.63\%\)). Reporting both numbers transparently teaches students why hyperparameters must be locked in on the validation split before touching the test set.

3 Step 2: Non-Overlapping Horizon Benchmarks (\(H = 7\text{d}\)) and Permutation Attribution

Because a 7-day trailing average overlaps by \(6/7\) days at \(H = 1\text{d}\), we evaluate models at both \(H = 1\text{d}\) and the non-overlapping \(H = 7\text{d}\) horizon against two transparent baselines:

  1. 7-Day Smoothed Persistence (\(\hat{I}_{t+h} = I_t\)): At \(H = 1\text{d}\), persistence achieves \(\mathrm{MAPE} = 4.71\%\) (\(R^2 = 0.9921\)), but at the non-overlapping \(H = 7\text{d}\) horizon its error jumps nearly seven-fold to \(\mathrm{MAPE} = 31.34\%\).
  2. Log-Linear Growth Extrapolation: Extrapolating recent exponential growth rates improves during steady climbs but suffers severe peak overshoot when a wave crests (\(\mathrm{MAPE} = 24.47\%\) at \(H = 7\text{d}\)).
  3. Causal Sequence Regressor (\(L_{\mathrm{val}}^* = 14\text{d}\)): Incorporating causal renewal ratios and behavioral covariates reduces non-overlapping 7-day-ahead error to \(\mathrm{MAPE} = 18.92\%\) (\(+61.4\%\) MSE skill over 7-day persistence).

3.1 Predictive Attribution vs. Causal Effect

Because diagnostic testing volume, policy stringency, and trailing \(\hat{R}_t^{\mathrm{causal}}\) respond endogenously to rising case waves, out-of-sample permutation RMSE shares (\(30.5\%\) testing volume, \(24.2\%\) causal \(\hat{R}_t^{\mathrm{causal}}\), \(16.5\%\) primary immunity, \(12.6\%\) booster uptake) measure predictive feature reliance within the forecasting model rather than interventional causal treatment effects.

Forecasting Horizon & Model1-Day Horizon (\(6/7\) Overlap)7-Day Horizon (Non-Overlapping)Key Methodological Lesson
7-Day Smoothed Persistence (Baseline 1)\(\mathrm{MAPE} = 4.71\%\) (\(R^2 = 0.9921\))\(\mathrm{MAPE} = 31.34\%\) (\(0.0\%\) Skill)High 1-day \(R^2\) is a mechanical artifact of 7-day rolling window overlap
Log-Linear Extrapolation (Baseline 2)\(\mathrm{MAPE} = 3.85\%\) (\(\mathrm{MDAPE} = 2.13\%\))\(\mathrm{MAPE} = 24.47\%\) (Peak Overshoot)Pure growth extrapolation overshoots severely at wave inflection points
Causal Sequence Model (Val-Selected \(L_{\mathrm{val}}^* = 14\text{d}\))\(\mathrm{MAPE} = 4.37\%\) (\(+21.6\%\) MSE Skill)\(\mathrm{MAPE} = 18.92\%\) (\(+61.4\%\) MSE Skill)2 weekly cycles + causal renewal ratio \(\hat{R}_t^{\mathrm{causal}}\) curb turning-point overshoot

4 Exploring Further: Research Directions

Research Track Core Question to Investigate Tools & Methods
1. Panel Cross-Validation Across Regions Does pooling sequence models across \(50\) asynchronous regional waves stabilize validation lookback selection \(L_{\mathrm{val}}^*\)? Hierarchical Panel Time Series, Clustered Block Bootstrap
2. Mechanistic Renewal Layers Can we embed the discrete renewal equation directly inside a neural network layer so predictions respect biological serial intervals? Physics/Biology-Informed Neural Layers, PyTorch
3. Reporting Delay Nowcasting How can Bayesian delay triangles correct right-censored recent counts before feeding them into the forecasting model? Negative-Binomial Nowcasting, Empirical Bayes

© 2026 Deepak Bastola

 

View source on GitHub